﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_Polls_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <div class="content-box-outer">
        <div class="content-box-right">
       <ul>
    <li><a href="Add_Edit.aspx" class="new">Thêm mới</a></li>
    <li class="content-box-selected"><a href="Polls.aspx">Bình chọn</a></li>
    
</ul>
        </div>
        <div class="content-box-left">
            <h1>
                Bình chọn</h1>
            
            <div class="tableToolBox" style="display: none">
                Show: <a class="current" href="#" onclick="return ChangePostFilterType('All')">All</a>
                | <a href="#" onclick="return ChangePostFilterType('Draft')">Drafts</a> | <a href="#"
                    onclick="return ChangePostFilterType('Published')">Published</a> <span id="filteredby">
                    </span>
                <div class="Pager">
                </div>
                <div class="PageSize">
                    <label for="pageSizeTop">
                        Items/Page</label>
                    <select id="pageSizeTop" name="pageSizeTop" onchange="return ChangePostPageSize(this)">
                        <option value="10" selected="selected">10</option>
                        <option value="25" >25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                </div>
            </div>
            <div id="Container">
                <%if (Count() ==0)
                  { %>
                <div class="info">
                    Chưa có bình chọn, <a href="Add_Edit.aspx" class="tooltip" title="Thêm mới chuyên mục">Thêm mới</a>.
                </div>
                <%} %>
                

                <div runat="server" id="divMsg" class="mInfo" visible="false" />
    <asp:GridView ID="gvPolls" runat="server" Width="100%" GridLines="None" 
    CssClass="beTable" BorderStyle="Solid" RowStyle-BorderWidth="0"
                    RowStyle-BorderStyle="None"  AlternatingRowStyle-BackColor="#f8f8f8"
                    AlternatingRowStyle-BorderColor="#f8f8f8" HeaderStyle-BackColor="#F1F1F1" CellPadding="3"
                    AutoGenerateColumns="false"
    DataKeyNames="PollID"
        OnRowDeleting="gvPolls_RowDeleting">
        <HeaderStyle CssClass="gridHead" />
        <Columns>
           
            <asp:TemplateField ShowHeader="False">
          
                <ItemTemplate>
                 <a href="Add_Edit.aspx?PollID=<%# Eval("PollID")%>">Sửa</a>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Delete"
                        Text="Xóa" OnClientClick="return confirm('Bạn có chắc chắn xóa dòng này?')" />
                </ItemTemplate>
            </asp:TemplateField>
          

                <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="ID">
                            <ItemTemplate>
                                <%# Eval("PollID")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Câu hỏi">
                            <ItemTemplate>
                                <%# Eval("Question") %>
                            </ItemTemplate>
                          
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Số lựa chọn">
                            <ItemTemplate>
                                <%# Eval("ChoiceCount")%>
                            </ItemTemplate>
                          
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Bình chọn">
                            <ItemTemplate>
                                <%# Eval("TotalVotes")%>
                            </ItemTemplate>
                          
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                         <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Kích hoạt">
                            <ItemTemplate>
                               <span class="published-<%#Eval("Active").ToString().ToLower() %>"></span> 
                            </ItemTemplate>
                          
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
        </Columns>
    </asp:GridView>
            </div>
            <div class="Pager">
            </div>
            <div class="PageSize" style="display: none">
                <label for="pageSizeBottom">
                    Items/Page</label>
                <select id="pageSizeBottom" name="pageSizeBottom" onchange="return ChangePostPageSize(this)">
                    <option value="10">10</option>
                    <option value="25" selected="selected">25</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                </select>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {

            $(".tableToolBox a").click(function () {
                $(".tableToolBox a").removeClass("current");
                $(this).addClass("current");
            });
        });
    </script>
</asp:Content>




